import React, { Component } from 'react'
import Item from '../Item';
import './index.css';
export default class Main extends Component {
    render() {
        let {todos} = this.props;
        return (
            <ul className="todo-main">
                {/* 控制暂无数据的元素显示 */}
                {todos.length === 0  && <li className="no-data">暂无数据</li>}

                {
                    todos.map(value => {
                        return <Item key={value.id}  {...value}  {...this.props} />;
                    })
                }
            </ul>
        )
    }

    
}
